#! /bin/bash
export LANG=zh_CN.UTF-8
HIVE_HOME=/usr/bin/hive


${HIVE_HOME} -S -e "
create database if not exists edu_dws;
use edu_dws;
drop table kxh_dws_web_chat_ems_day_cnt;
create table if not exists kxh_dws_web_chat_ems_day_cnt(
  -- 维度
    create_time_day                  string     comment '天',
    area                         string  comment '地域',
    seo_source                   string comment '搜索来源',
    origin_channel               string   comment '投放渠道',
    from_url             string comment '会话来源页面',
     --分组标记
    group_type string COMMENT 'all,area,seo_source,origin_channel，from_url',
   --日统计
    session_id_count         bigint   comment '访问Session个数',
   sid_count                bigint comment '访问用户量',
    ip_count                  bigint  comment '访问IP个数',
    con_rate             decimal(38,4)  comment'咨询率'

 )   comment'每日访问咨询情况'
row format delimited
fields terminated by '\t'
stored as orc tblproperties ('orc.compress'='SNAPPY');"